<me:UIVKPOS  x:Class="WPFExcelReport.TPVK03"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"
    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM"  
    xmlns:MF="clr-namespace:WPFExcelReport;assembly=TICC_MKRF"
     xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT"
     xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"
        xmlns:me="clr-namespace:WPFExcelReport"
     xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
    xmlns:ChartEx="clr-namespace:WPFExcelReport.Chart;assembly=ITXVIEWS"
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIVKPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVKPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions> 
        <StackPanel Grid.Row="0" Grid.Column="0" >
            <WrapPanel>
                <me:TSACHBE SACHBE="{Binding SACHBE,ElementName=TV}"  />
                <me:TYARNTYP YARNTYP="{Binding YARNTYP,ElementName=TV}"  />
                <GS:TYNE YNE="{Binding YNE,ElementName=TV}"  />
                <MU:TYSPPART KDPARTIE="{Binding SPINLOT,ElementName=TV}"  />
                <me:TKDKOMM KDKOMM="{Binding KDKOMM,ElementName=TV}"  />
                <VK:TBESTNR BESTNR="{Binding BESTNR,ElementName=TV}"  />
                <KD:TSKD02   KUNDNR="{Binding KUNDNR,ElementName=TV}"  />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=销售单}}"/>
                    <ex:TXT72 PRE="  "  MaxLength="2" Grid.Column="1" Text="{Binding KRS,ElementName=TV}" CharacterCasing="Upper" Width="40"/>
                    <ex:TXT72 PRE="000000" MaxLength="6" Grid.Column="2" Text="{Binding LFD,ElementName=TV}" Width="80"/>
                </Grid>
            </WrapPanel>
            <WrapPanel>
                <TextBlock Text="{Binding Source={Localization:Translate Word=色号}}"/>
                <ex:TXT72 Text="{Binding FARBE,ElementName=TV}" Width="100" MaxLength="10"/>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition> 
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=交期晚于}}"/>
                    <TextBox Grid.Column="1" Text="{Binding DTEND,ElementName=TV}" Width="100"/> 
                </Grid> 
                <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" Height="20"  Width="24" Margin="20,0,0,0"   IsEnabled="True" Click="QueryCommand">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                 
            </Grid>
                <Button Grid.Column="0"  Margin="20,0,0,0"   
                        Click="QueryTDPlanCommand">
                    <Button.Content>
                        <WrapPanel>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=生产开单}}"/>
                            <ex:NumericBox Text="{Binding DTSTART,ElementName=TV}" Width="80"/>
                            <ex:NumericBox Text="{Binding DTEND,ElementName=TV}" Width="80"/>
                        </WrapPanel>
                    </Button.Content>                     
                </Button>
            </WrapPanel>
        <WrapPanel>
                <VK:TVK04 ORDERNUM="{Binding Path=AUF,ElementName=TV}"/>
            </WrapPanel>  
        </StackPanel> 
        <DataGrid Grid.Row="1" 
                  Grid.Column="0" Grid.ColumnSpan="2"
                AutoGenerateColumns="False" 
                  EnableRowVirtualization="False" 
                  Name="dlgMaster"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>                 
                <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="" Width="Auto" MinWidth="24" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD}" Header="{Binding Source={Localization:Translate Word=销售单}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header=" " Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=ABACOLORREF,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=批号}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=纱线}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=留位}}" Width="Auto" />                
                <DataGridTextColumn Binding="{Binding Path=VKPFREIGE, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=发货}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPVERS, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=走货}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPFAKT, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=开票}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKKBESTNR}" Header="{Binding Source={Localization:Translate Word=申购单号}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=KDKNAME,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=客户}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKCOM, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=成份}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPKDFARBNR, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=客人色号}}" Width="Auto" MinWidth="100"/>
                <DataGridTextColumn Binding="{Binding Path=VKKBESTNR}" Header="{Binding Source={Localization:Translate Word=合同号}}"  Width="Auto" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=STRENGTH, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=强力标准}}"  Width="Auto" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=TWIST, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=捻度标准}}"  Width="Auto" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=COLORSTD, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=颜色标准}}"  Width="Auto" MinWidth="24"/>
                <DataGridTextColumn Binding="{Binding Path=YARNTYP}" Header="{Binding Source={Localization:Translate Word=纱型}}"  Width="Auto" MinWidth="24"/>
                <DataGridTextColumn Binding="{Binding Path=YNE}" Header="{Binding Source={Localization:Translate Word=纱支}}"  Width="Auto" MinWidth="24"/>
                <DataGridTextColumn Binding="{Binding Path=VAAPRGR}" Header="{Binding Source={Localization:Translate Word=用途}}"   Width="Auto"  MinWidth="24"/>
                <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}" Header="{Binding Source={Localization:Translate Word=创建日期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="{Binding Source={Localization:Translate Word=跟单}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=ABADATE}" Header="{Binding Source={Localization:Translate Word=计划日期}}" Width="Auto" MinWidth="30" />  
            </DataGrid.Columns>
        </DataGrid>
        <WrapPanel Grid.Row="2" >
            <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TKEY3}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM3}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
        </WrapPanel>
    </Grid>
    </me:UIVKPOS>
